"""
计算棋盘里的所有麦粒数
和单个方格的麦粒数
"""


def square(number):
    """
    计算该方格里的麦粒数
    :param number:  int
    :return: int 麦粒数
    """
    if 1 <= number <= 64:
        return pow(2, number - 1)
    raise ValueError("square must be between 1 and 64")


def total():
    """
    总共的麦粒数
    :return:  int
    """
    total_num = 0
    for i in range(1, 65):
        total_num += square(i)
    return total_num
